package org.springblade.modules.repair.entity;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;

import java.util.Date;
import java.util.List;

/**
 * 维修报告
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "blade_maintain_report")
public class MaintainReport extends TenantEntity {
    /**
     * 任务id
     */
    @TableField(value = "plan_id")
    private Long planId;

    /**
     * 电梯id
     */
    @TableField(value = "elevator_id")
    private Long elevatorId;

    /**
     * 项目id
     */
    @TableField(value = "building_id")
    private Long buildingId;

    /**
     * 电梯地址
     */
    @TableField(value = "elevator_address")
    private String elevatorAddress;

    /**
     * 项目名称
     */
    @TableField(value = "building_name")
    private String buildingName;

    /**
     * 电梯品牌名称
     */
    @TableField(value = "brand_name")
    private String brandName;

    /**
     * 额定载重量
     */
    @TableField(value = "supporting_power")
    private String supportingPower;

    /**
     * 额定速度
     */
    @TableField(value = "speed")
    private String speed;

    /**
     * 发送状态 1-待发送 2-已发送 3-发送失败
     */
    @TableField(value = "send_status")
    private Integer sendStatus;

    /**
     * 报告详情
     */
    @TableField(value = "report_data",typeHandler = JacksonTypeHandler.class)
    private List<JSONObject> reportData;

    /**
     * 报告文件地址
     */
    @TableField(value = "report_file")
    private String reportFile;

    /**
     * 报告图片地址
     */
    @TableField(value = "report_img")
    private String reportImg;

    /**
     * 工单实际执行人员名称
     */
    @TableField(value = "plan_user_name")
    private String planUserName;

    /**
     * 工单创建时间
     */
    @TableField(value = "plan_create_time")
    private Date planCreateTime;

    /**
     * 工单完成时间
     */
    @TableField(value = "plan_finish_time")
    private Date planFinishTime;

    /**
     * 维修工单类型 1-内部整改 2-客户报障
     */
    @TableField(value = "work_order_type")
    private Integer workOrderType;

    /**
     * 报告人名称
     */
    @TableField(value = "report_user_name")
    private String reportUserName;

    /**
     * 报告人角色
     */
    @TableField(value = "report_user_role")
    private String reportUserRole;
}
